<h1>DefineJPEGImage</h1>

<p>DefineJPEGImage is used to define a JPEG encoded image. DefineJPEGImage 
instructions only contain the image data, the encoding table for the image is 
defined in a JPEGEncodingTable instruction. All images using a shared 
JPEGEncodingTable to represent the encoding table have the same compression 
ratio.</p>

<table>

<tr>
<th nowrap>Field Name</th>
<th>Type</th>
<th>Size</th>
<th>Description</th>
</tr>

<tr>
<td nowrap valign="top">type</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">10</td>
<td>Identifies the DefineJPEGImage instruction when it is encoded. It is encoded 
with the length field as a 16-bit integer (Little-endian byte order).</td>
</tr>

<tr>
<td nowrap valign="top">length</td>
<td nowrap valign="top">unsigned bit</td>
<td nowrap valign="top" align="right">6</td>
<td>The length in bytes of the body of the instruction when it is encoded. If the length is greater 
than 62 then this field is set to 0x3F and the length is encoded using the 
extendedLength field. Encoded with the type field as a 16-bit integer.</td>
</tr>

<tr>
<td nowrap valign="top">extendedLength</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">32</td>
<td>Optional. Contains the length in bytes of the encoded instruction if it is
greater than 62 bytes. If the length is 62 bytes or less then this field is 
omitted.</td>
</tr>

<tr>
<td nowrap valign="top">identifier</td>
<td nowrap valign="top">unsigned int</td>
<td nowrap valign="top" align="right">16</td>
<td>The unique identifier for this image definition. This is used when adding or removing 
the shape from the display list or when the shape is used as part of another 
object such as a button.</td>
</tr>

<tr>
<td nowrap valign="top">image</td>
<td nowrap valign="top">byte[n]</td>
<td nowrap valign="top" align="right">&nbsp;</td>
<td>An array of bytes containing the JPEG compressed image.</td>
</tr>

</table>

<p>Images can only be displayed inside a shape using the BitmapFill.</p>

<p>The image data may be taken directly from a JPEG image file. No further 
decoding is necessary.</p>

<p>Although the DefineJPEGImage instruction is supposed to be used with the 
JPEGEncodingTable class which defines the encoding table for the images it is 
not essential. If an JPEGEncodingTable object is created with an empty encoding 
table then the Flash Player will still display the JPEG image correctly.</p>

<h2>History</h2>

<p>The DefineJPEGImage instruction represents the DefineBits data structure from 
the Macromedia Flash (SWF) File Format Specification. It was introduced in Flash 1.</p>
